#include <iostream>
#include "FigureContainer.h"

using namespace std;

int main()
{
    FigureContainer fg;
    try {
        fg.inputFile(R"(C:\Users\user\Desktop\figures.txt)");
    }
    catch(exception& e) {
        cout << "exception caught: " << e.what() << endl;
    }

    for (size_t i = 0; i < fg.size(); ++i) {
        vector<double> tmp = fg[i]->getData();
        cout << fg[i]->type() << " ";
        for (size_t j = 0; j < tmp.size(); ++j) {
            cout << tmp[j] << " ";
        }
        cout << endl;
    }

    try {
        for (size_t i = 0; i < fg.size(); ++i) {
            fg[i]->extension(i + 1);
        }
        fg.outputFile(R"(C:\Users\user\Desktop\exFigures.txt)");
    }
    catch(exception& e) {
        cout << "exception caught: " << e.what() << endl;
    }

    cout << endl << "Happy end" << endl;
    return 0;
}
